﻿using System;
using System.Collections.Generic;
using System.Linq;
using OpenAuth.App.Request;
using OpenAuth.App.Response;
using OpenAuth.App.SSO;
using OpenAuth.Repository.Domain;


namespace OpenAuth.App
{
    public class FlowApp : BaseApp<Flow>
    {
        public RevelanceManagerApp ReleManagerApp { get; set; }

        /// <summary>
        /// 加载列表
        /// </summary>
        public TableData Load(QueryFlowListReq request)
        {

            var records = Repository.GetCount(null);

            return new TableData
            {
                count = records,
                data = Repository.Find(request.page, request.limit, "CreateDate desc")
            };
        }

        public void Add(Flow obj)
        {
            Repository.Add(obj);
        }
        
        public void Update(Flow obj)
        {
            UnitWork.Update<Flow>(u => u.Id == obj.Id, u => new Flow
            {
               //todo:要修改的
            });

        }

    }
}